#include "rtpsthread.h"

RtpsThread::RtpsThread(QObject *parent) : QObject(parent)
{

}

RtpsThread::~RtpsThread()
{
    delete m_ffmpeg;
}

void RtpsThread::run()
{
#if HW_ACC_FIND_DECODEC
#if HW_ACC
    m_hw_ffmpeg->play();
#else
    m_hw_ffmpeg_find->play();
#endif
#else
    m_ffmpeg->play();
#endif
}

void RtpsThread::setFFmpeg(FFmpeg *ffmpeg)
{
    this->m_ffmpeg = ffmpeg;
}

void RtpsThread::setHWFFmpegFind(HWFFmpegFind *hw_ffmpeg_find)
{
    this->m_hw_ffmpeg_find = hw_ffmpeg_find;
}

void RtpsThread::stopThread()
{
#if HW_ACC
    m_hw_ffmpeg_find->stopReadFrame();
#else
    m_ffmpeg->stopReadFrame();
#endif
}

